<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/24
 */
namespace app\football\model;

use think\Model;

class CardComment extends Model{

    // 设置当前模型对应的完整数据表名称  帖子评论表
    protected $table = 'card_comment';

    //模型连接数据库
    protected $connection  = 'zq';

    //关联用户表
    public  function getUser(){
        return  $this->hasOne('Userinfo','id','uid');
    }

    //关联帖子表
    public  function getCard(){
        return  $this->hasOne('BbsCard','id','card_id');
    }

    //关联社区表
    public  function getBbs(){
        return  $this->hasOne('BbsMain','id','main_id');
    }
}